function iniMyNews() {
  let userIcon = document.getElementsByClassName('user-icon')[0];
  loadHeadImg();
  isLogin();
  getAllNews('by-user-id', sessionStorage.getItem('id'))
    .then(value=> {
      let username = document.getElementsByClassName('username')[0];
      username.innerText = value.username;
      if(value.headImg == null) {
        userIcon.src = '../img/user-icon.png';
      }else {
        userIcon.src = 'http://' + value.headImg;
      }
    }).catch(error => {
      console.log(error);
    })
}
function iniOthersNews() {
  let userIcon = document.getElementsByClassName('user-icon')[0]
  loadHeadImg();
  let params = new URLSearchParams(location.search);
  id = params.get('id');
  isLogin();
  getAllNews('by-user-id', id)
    .then(value=> {
      let username = document.getElementsByClassName('username')[0];
      username.innerText = value.username + '的动态';
      if(value.headImg == null) {
        userIcon.src = '../img/user-icon.png';
      }else {
        userIcon.src = 'http://' + value.headImg;
      }
    }).catch(error => {
      console.log(error);
    })
}